The invention relates to a video encoder and a method of predictively encoding images with reference to one reference image in a first prediction mode and to two reference images in a second prediction mode.
Predictive video encoders as defined in the opening paragraph are generally known. For example, the MPEG video compression standard provides a first prediction mode in which images are encoded with reference to a previous image of the sequence. Thus, encoded images are referred to as P-pictures. The previous image may be an autonomously encoded I-picture or another P-picture. The MPEG standard also provides a second prediction mode in which images are encoded with reference to a previous image as well as a subsequent image of the sequence. Thus, encoded images are referred to as B-pictures. They are more efficiently encoded than P-pictures.
Motion compensation is usually applied to the respective reference images. To this end, the known video encoders include a motion estimation circuit which searches motion vectors representing motion between the input image and respective reference image(s). In the first (P) prediction mode, the motion estimation circuit is used for searching forward motion vectors representing motion between input image and previous image. In the second (B) prediction mode, the motion estimation circuit is used in a first interval of the frame encoding period for searching forward motion vectors representing motion between input image and previous image, and in a second interval of said frame encoding period for searching backward motion vectors representing motion between input image and subsequent image.
It is an object of the invention to further improve the video encoder.
To this end, the video encoder in accordance with the invention is characterized in that the motion estimation circuit is arranged to use the first interval of the frame encoding period in the first (P) prediction mode to search motion vectors representing motion between an input image and said one reference image, and to use the second interval of said frame encoding period to refine the motion vectors found in the first interval.
The motion estimation circuit of the prior-art video encoder executes the motion vector search twice within a frame encoding period in the second (B) prediction mode. One run, or pass, of the search process is used to generate the forward motion vectors, another run is used to generate the backward motion vectors. In the first (P) prediction mode, forward motion vectors need to be searched only. The invention is based on the recognition that the motion estimator can be used a second time in the P-prediction mode so as to further refine the search for forward motion vectors. It is achieved with the invention that the motion vectors associated with P-pictures are more precise than the motion vectors associated with B-pictures. This is attractive because P-pictures are generally wider apart from each other than B-pictures.
In an embodiment of the encoder, in which the motion estimation circuit is arranged to search a motion vector from among a plurality of given candidate motion vectors, said candidate motion vectors in the second interval are formed by predetermined variations of the motion vector found in the first interval.